
methods: {

  /** 提交按钮 */
  submitForm() {
    this.$refs["form"].validate(valid => {
      if (valid) {
        // 将 vehicleId 转换为 sysVehicles 集合，包含 id、licensePlate 和 status
        this.form.sysVehicles = this.form.vehicleId.map(id => {
          const vehicle = this.vehicleList.find(v => v.id === id);
          return {
            id: vehicle.id,
            licensePlate: vehicle.licensePlate,
            status: vehicle.status
          };
        });

        if (this.form.id != null) {
          updateRequests(this.form).then(response => {
            this.$modal.msgSuccess("修改成功");
            this.open = false;
            this.getList();
          });
        } else {
          addRequests(this.form).then(response => {
            this.$modal.msgSuccess("新增成功");
            this.open = false;
            this.getList();
          });
        }
      }
    });
  },

}
